package com.bstek;

import com.bstek.dorado.web.boot.DoradoApplicationInitlizalizer;
import org.malagu.linq.LinqConfiguration;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
import org.springframework.boot.autoconfigure.jms.JndiConnectionFactoryAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author admin
 */
@RestController
//@EnableGlobalMethodSecurity(prePostEnabled = true)
@SpringBootApplication
@Import(LinqConfiguration.class)
@ComponentScan({"com.bstek.dorado.web.boot","com.bstek.xxl.job.admin"})
@MapperScan("com.bstek.*.mapper")
public class SampleApplication {

    	public static void main(String[] args) throws Exception {

            ConfigurableApplicationContext run = SpringApplication.run(SampleApplication.class, args);
//            System.out.println(1111111);

//		start(args);
	}
    public static void start(String[] args) {

        SpringApplication app = new SpringApplication(SampleApplication.class);
        DoradoApplicationInitlizalizer doradoInitlizalizer = new DoradoApplicationInitlizalizer();
        try {
            doradoInitlizalizer.initSpringApplication(app);
        } catch (Exception e) {
            e.printStackTrace();
        }
        app.run(args);
    }



}
